A 5 spin error correction code has been derived that corrects both correlated and uncorrelated errors in the phases of two independent spins. This method permits an un biased measurement of the local correlation of random external fields.